package com.samoiloff.framework.commands {
	import flash.events.EventDispatcher;

	/**
	 * @author Damirr
	 */
	public class Command extends EventDispatcher implements ICommand {
		
		protected var _started	: Boolean;
		
		public function Command() {
			
		}
		
		public function start():void {
			_started = true;
			dispatchEvent(new CommandEvent(CommandEvent.ACTION_START, this));
		}

		public function destroy():void {
			
		}

		protected function finish():void {
			_started = false;
			dispatchEvent(new CommandEvent(CommandEvent.ACTION_COMPLETE, this));
		}
		
		public function cancel():void {
			_started = false;
			dispatchEvent(new CommandEvent(CommandEvent.ACTION_CANCEL, this));
		}
		
		public function get started(): Boolean {
			return _started;
		}

	}
}
